Packet forwarding

ABSTRACT

A PE and a method of forwarding packet are provided. According to an example of the method, when receiving a packet, the PE may determine a vPort associated to a port through which the packet is received. When a forwarding entry adding condition is satisfied, the PE may add a first forwarding entry in a forwarding table by recording the first vPort as an egress port, a source MAC address of the packet as a MAC address and an VLAN identifier of the VLAN associated with the first vPort as a VLAN identifier. Subsequently, the PE may search the forwarding table for a second forwarding entry matching the destination MAC address of the packet and the VLAN to which the packet belongs. The PE may search a port associating relationship table for a port associated to a second vPort in the second forwarding entry to forward the packet.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201610464540.4 entitled “METHOD AND DEVICE FOR FORWARDING PACKET” whichis filed on Jun. 21, 2016, the entire content of which is incorporatedherein by reference.

BACKGROUND

802.1BR defines that a switch with port expanding capability may consistof a Controlling Bridge (CB) and a plurality of Port Extenders (PEs)which connected with each other in a tree manner. The PEs are configuredto expand port quantity and port accessing capability for the CB. Forexample, a PE may be connected with a CB or an upper PE through anupstream port, and connected with a lower PE through a cascade port. TwoPEs may be cascaded with each other. For example, a CB may be connectedwith a plurality of PEs through cascade ports and configured to manageVirtual Port (vPort) mapping for ports on the PEs. For forwarding apacket, the PE may load an Ethernet-Tag (E-TAG) carrying an E-TagChannel Identifier (ECID) associated to a source port through which thepacket is received into the packet and then send the packet to the CB,so that the CB may decide how to forward the packet.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a schematic diagram of a network topology accordingto the present disclosure.

FIG. 2 schematically illustrates a flow chart of a method for forwardingpacket according to an example of the present disclosure.

FIG. 3 schematically illustrates a network in which a method forforwarding packet may be applied according to an example of the presentdisclosure.

FIG. 4 schematically illustrates a network in which a method forforwarding packet may be applied according to another example of thepresent disclosure.

FIG. 5 is a hardware structural diagram of a PE according to an exampleof the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

The technical solution in the embodiments of the present disclosure willbe described clearly and completely in conjunction with the accompanyingdrawings in the embodiments of the present disclosure. It will beapparent that the described embodiments are merely a part of theembodiments rather than all the embodiments of the present disclosure.Based on the embodiments of the present disclosure, all otherembodiments obtained by those skilled in the art without making creativework are within the scope of protection of the present disclosure.

FIG. 1 shows a network topology defined in accordance with 802.1BR.

As shown in FIG. 1, assuming that a Virtual Machine (VM) 110 wants toaccess a VM 112, the VM 110 may send a packet in which the destinationMAC address is the MAC address of the VM 112 to a PE 120. When the PE120 receives the packet, the PE 120 may add an E-Tag to the packet forcarrying an E-tag Channel Identifier (ECID) associated to a source port(hereinafter, it may also be referred to “an ECID of the source port”)and send the packet to a PE 121 through an upstream port. Accordingly,the packet may be sent by the PE 121 to a CB 130. When receiving thepacket, the CB 130 may search a Media Access Control (MAC) forwardingtable according to a destination MAC address of the packet, so as todetermine an egress port for forwarding the packet. When the determinedegress port is a service port of the CB 130, the CB 130 may remove theE-TAG of the packet and forward the packet through the determined egressport. When the determined egress port is a vPort, the CB 130 mayreconstruct the E-TAG of the packet to carry a destination ECIDcorresponding to the vPort and send the packet to the PE 121 through acascade port. The PE 121 may determine a cascade port according to thedestination ECID carried by the E-TAG of the packet, and send the packetto the PE 120 through the determined cascade port. When receiving thepacket, according to the ECID carried in the E-TAG of the packet, the PE120 may determine that an egress port for forwarding the packet is alocal port. In this case, the PE 120 may remove the E-TAG of the packetand forward it through the determined egress port. Ultimately, the VM112 will receive the packet originally sent from the VM 110.

As may be seen from FIG. 1, when the VM 110 accesses the VM 112, even ifthe VM 110 and the VM 112 are connected with the same PE, the packet maynot be directly forwarded by the jointly-connected PE 121 in accordancewith a path 1, but is forwarded from the VM 110 to a CB throughtwo-level PE, and then is forwarded from the CB to the VM 112 throughtwo-level PE. Similarly, when different VMs on the same tree branch areaccessed from each other, for example, the VM 110 and the VM 113 in FIG.1 are different VMs on the same tree branch (the branch of the PE 121).Multi-level forwarding is also needed when the VM 110 and the VM 113 areaccessed from each other, which increases the load of a forwarding pathand lengthens a forwarding time delay. At the same time, since thecascade links between the CB and the PE and between two PEs are occupiedfor many times, the forwarding efficiency of the cascade links isreduced

In view of this, the present disclosure provides a method of forwardingpacket, which allows not to forward a packet through CB but to forwardthe packet in accordance with the shortest path when different VMs underthe same PE are accessed from each other or VMs connecting withdifferent PEs on the same tree branch are accessed from each other, soas to effectively shorten the forwarding path and improve the forwardingefficiency of the cascade links between the CB and the PE and betweentwo PEs.

FIG. 2 schematically illustrates flow chart of a method for forwardingpackets according to an example of the present disclosure. As shown inFIG. 2, the flow may include Blocks 201 to 204.

At block 201: a PE may receive a packet.

At block 202: The PE may determine a first vPort associated to a portthrough which the packet is received.

For example, at Block 202, the PE may determine the first vPortassociated to the port through which the packet is received depending ona port through which the PE receives the packet.

In an example, when the PE receives the packet through a first userport, the PE may search a port associating relationship table for thevPort associated to the first user port as the first vPort.

For example, when being powered up, the PE may report its every port(including a user port and an upstream port, etc.) to the CB. The CB mayassociate a vPort to each port respectively reported by the PE, and mayissue a port associating relationship table storing the associatingrelationship of port and vport to the PE. After receiving the packetfrom the first user port, the PE may search the port associatingrelationship table for the vPort corresponding to the first user port asthe first vPort.

In another example, after receiving a packet from the first user port,the PE may determine a vPort which is assigned in advance to thecharacteristic parameter carried in the packet as the first vPort,wherein the characteristic parameter may include user information of aVM, such as the MAC address of the VM, the IP address of the VM, etc.

The user port of the PE is connected with the VM. Further, the userinformation of the VM may characterize the user port connecting with theVM. Therefore, the first vPort associated to the port through which thepacket is received may be understood as the first vPort associated tothe VM connecting with the port which the packet is received.

For example, when the PE is powered up, the PE may report the userinformation of the VM connecting with each user port and its every ports(including a user port and a upstream port, etc.) to the CB. The CB mayassociate a vPort for each port reported by PE respectively, and mayissue the port associating relationship table storing the associatingrelationship of port and vport to the PE. In addition, the CB may assigna vPort to the VM connecting with each user port of the PE. The vPortassigned to the VM connecting with each user port is the vPortassociated to each user port respectively in the port associatingrelationship table. The CB issues a configuration table storingassociating relationship of the user information of the VM and vPort tothe PE.

After receiving the packet from the first user port, the PE may identifythe characteristic parameter carried in the packet, such as the sourceMAC address and the source IP address of the packet. The source MACaddress and the source IP address are the source MAC address and thesource IP address of the VM corresponding to the port through which thepacket is received. The PE may search a configuration table for a vPortcorresponding to the characteristic feature carried in the packet suchas the source MAC address and so on as the first vPort.

In another example, when the PE receives a packet through the firstcascade port, the PE may determine the vPort associated to a source ECIDcarried in a first tag of the packet as the first vPort.

In the initialization configuration, the CB may issue the associatingrelationship table of a port on the PE and a vPort and the associatingrelationship table of a vPort and a ECID. It may be seen that the porton the PE has a corresponding relationship with the ECID. Therefore,determining the first vPort may be understood as determining a firstvPort which is associated to the ECID corresponding to the port throughwhich the packet is received.

For example, after receiving a packet from a cascade port, the PE mayobtain a ECID from a first tag of the packet, search the associatingrelationship table of the vPort and the ECID for a vPort correspondingto the ECID as the first vPort.

At block 203: The PE may add a first forwarding entry in a forwardingtable when a forwarding entry adding condition is satisfied, byrecording the first vPort as an egress port in the first forwardingentry, recording a source MAC address of the packet as a MAC address inthe first forwarding entry, and recording the VLAN identifier of theVLAN associated with the first vPort as a Virtual Local Area Network(VLAN) identifier in the first forwarding entry.

wherein, the forwarding entry adding condition may be set based on theprinciple that the forwarding entry is not established repeatedly andthe MAC address is not moved and the like. For example, the forwardingentry adding condition may include any one or more of the followingconditions:

1) there is no forwarding entry in which the MAC address is the sourceMAC address of the packet in the forwarding table; or2) the packet is received through a user port, and the learnedforwarding entry matching the source MAC address of the packet islearned from another packet received through an upstream port.

Herein when the condition 2) is satisfied, the learned forwarding entrymatching the source MAC address of the packet may be deleted. Thecondition 1) may ensure that the forwarding entry matching the sourceMAC address of the packet is not added repeatedly in the forwardingtable; and the condition 2) may prevent the MAC address from moving toensure that the forwarding entry learned from the user port takesprecedence.

In an example, the process of learning a forwarding entry by a packetreceived through an upstream port may include: if the forwarding entrymatching the destination MAC address of the packet cannot be acquiredfrom every PE, the packet may be sent to a CB through the each PE andbroadcast by the CB. During the process of broadcasting by the CB to theeach PE, after the PE receives the packet broadcast by the CB from theupstream port, if there is no forwarding entry in which the MAC addressis the source MAC address of the packet on the PE, the PE may learn theforwarding entry by the packet, by recording the source MAC address ofthe packet as the MAC address, recording the vPort associated to theupstream port as the egress port, and recording the VLAN identifier towhich the packet belongs as the VLAN identifier.

At block 204: The PE may search the forwarding table for a secondforwarding entry matching a destination MAC address of the packet and aVLAN identifier of the VLAN to which the packet belongs.

In an example, at block 204, searching the forwarding table for a secondforwarding entry matching the destination MAC address of the packet andthe VLAN identifier of a VLAN to which the packet belongs may includethat: the PE may search the forwarding table for a second forwardingentry matching the destination MAC address of the packet and the VLANidentifier of the VLAN associated with the first vPort when the packetis received through a first user port.

The PE may search the forwarding table for a second forwarding entrymatching the destination MAC address of the packet and the VLANidentifier of the VLAN in the second tag carried in the packet when thepacket is received through a cascade port.

At block 205: The PE may search a port associating relationship tablefor a port which is associated to a second vPort in the secondforwarding entry and may forward the packet through the port associatedto the second vPort.

In an example, at Block 205, if the port associated to the second vPortis an upstream port and the packet is received through a first userport, the PE may add a first tag and a second tag into the packet, andsend the packet with the first tag and the second tag through theupstream port. In another example, at Block 205, if the port associatedto the second vPort is a second cascade port and the packet is receivedthrough a first user port, the PE may add a first tag and a second taginto the packet, and send the packet with the first tag and the secondtag through the second cascade port. If the port associated to thesecond vPort is a second user port and the packet is received through afirst user port, the PE may send the packet through the second userport.

At block 205, if the port associated to the second vPort is an upstreamport and the packet is received through a first cascade port, the PE maysend the packet through the upstream port. At block 204, if the portassociated to the second vPort is a second cascade port and the packetis received through a first cascade port, the PE may send the packetthrough the second cascade port. If the port associated to the secondvPort is a second user port and the packet is received through a firstcascade port, the PE may remove the first tag and the second tag carriedby the packet, and send the packet without the first tag and the secondtag through the second cascade port.

In another example, at block 205, if the PE does not find the secondforwarding table entry in the forwarding table and the packet isreceived through a first user port, the PE may add a first tag and asecond tag in the packet, and send the packet through an upstream port.If the PE does not find the second forwarding table entry in theforwarding table and the packet is received through a first cascadeport, the PE may send the packet through the upstream port forforwarding.

Herein the first tag may carry a source ECID, the source ECID is an ECIDassociated with the first vPort, and the second tag may carry an VLANidentifier of a VLAN associated with the first vPort.

As may be seen from the flow shown in FIG. 2, a PE may store aforwarding table. In this way, when a packet is received, the PE maysearch the forwarding table for a forwarding entry matching thedestination MAC address of the packet and the VLAN identifier of a VLANto which the packet belongs. The PE may forward the packet through theuser port when the port associated to the vPort in the matchingforwarding entry is a user port. The packet forwarding mechanism of thata PE blindly sends a packet to a CB through each upstream port and thepacket is forwarded ultimately by the CB is no longer applied. It can beachieved by that the packet may be forwarded not through the CB but tobe forwarded in accordance with the shortest path when different VMsunder the same PE or VMs connecting with different PEs on the same treebranch are accessed from each other, so as to effectively shorten theforwarding path and effectively improve the forwarding efficiency of thecascade links between the CB and the PE and between the PE and the PE.

The flow shown in FIG. 2 is described below by two specific embodiments.

FIG. 3 schematically illustrates networking diagram in which a method offorwarding packet may be applied, according to Embodiment 1 of thepresent disclosure. In FIG. 3, the VM 311 and the VM 312 are connectedwith the same PE 321. In the Embodiment 1, taking the VM 311 accessingthe VM 312 as an example, the above method of forwarding packet isdescribed in detail.

The VM 311 may send a packet which may be denoted as packet 1. Thesource MAC address of the packet 1 is the MAC address of the VM 311(denoted as MAC1) and the destination MAC address of the packet 1 is theMAC address of the VM 312 (denoted as MAC2).

The PE 321 may receive the packet 1 through a user port (denoted asPort1_1). The user port here may be a physical port or a logical port.The present disclosure is not particularly limited thereto.

The PE 321 may determine a vPort associated to the Port1_1.

That determining the vPort associated to the Port1_1 by PE 321 may beachieved by a plurality of embodiments. Two embodiments are taken as anexample simply.

Embodiment 1

When being powered up, the PE may report each of its own ports(including a user port and an upstream port, etc.) to a CB. Afterreceiving the ports reported by PE, the CB may associate an vPort foreach port on the PE respectively (it also means assigning vPorts to thePE) and send a port associating relationship table to the PE. One porton the same PE may be associated to a plurality of vPorts.

Based on this, in the Embodiment 1, the PE 321 may search the portassociating relationship table from the CB 330 for the vPort associatedto the Port1_1. When the PE 321 acquires a plurality of vPortsassociated to the Port1_1 from the port associating relationship table,one of the vPorts may be specified as the vPort associated to thePort1_1.

Embodiment 2

When being powered up, the PE may report the user information of the VMconnecting with each user port and each of its own ports (including auser port and an upstream port, etc.) to a CB. The CB may associate avPort for each port reported by the PE, and may issue to the PE the portassociating relationship table storing a port and a vPort. In addition,the CB may assign a vPort to the VM connecting with each user port ofthe PE. A vPort assigned to the VM connecting with each user port is avPort associated to each user port respectively in the port associatingrelationship table. The CB may issue a configuration table storing userinformation of the VM and a vPort associating relationship to the PE.

Based on this, in the Embodiment 2, after receiving a packet from thePort1_1, the PE 321 may identify a characteristic parameter carried inthe packet. The characteristic parameter may include the userinformation of the VM, such as the source MAC address and the source IPaddress of the packet, etc. The PE 321 may search the configurationtable for the vPort corresponding to the characteristic parameter as thevPort associated to the Port1_1.

For ease of description, the vPort associated to the Port1_1 throughwhich the packet 1 is received is denoted as vPort1_1 herein.

In the Embodiment 1 or Embodiment 2, after finishing assigning the vPortto each port of the PE, the CB may associate an ECID for each vPort.Herein the ECID associated to each vPort on the same PE is unique, whilethe same ECID may be associated to different vPorts on different PEs.For example, the ECID of the vPort1_1 on the PE 321 is ECID1, and theECID of the vPort2_1 on the PE 322 is ECID1.

When a forwarding entry adding condition is satisfied, the PE 321 mayadd a forwarding entry (denoted as entry 1) learned by the packet 1received through the VM 311 in a forwarding table. Here, The entry 1 mayinclude the vPort1_1 as an egress port, the source MAC address MAC1 ofthe packet 1 as a MAC address and the identifier of the VLAN (denoted asVLAN1) associated with the vPort1_1 as a VLAN identifier. Table 1 showsthe structure of the entry 1. Herein the port associated to the vPort1_1may be the user port of the PE 321, e.g. Port1_1.

TABLE 1 MAC address Egress port VLAN MAC1 vPort1_1 VLAN1

The PE 321 may search the forwarding table for the forwarding entry(denoted as entry 2) matching the destination MAC address MAC2 of thepacket 1 and the VLAN identifier of the VLAN1. Herein the entry 2 may bepreconfigured on the PE 321 or the entry 2 may be added to theforwarding table of the PE 321 by the same way the entry 1 is learned.The egress port of the entry 2 is vPort1_2. Table 2 shows the entry 2.The case where the entry 2 is not acquired will be describedhereinafter.

TABLE 2 MAC address Egress port VLAN MAC2 vPort1_2 VLAN1

The PE 321 may search the port associating relationship table for theport associated to the vPort1_2.

If the PE 321 finds that the port associated to the vPort1_2 is a userport (denoted as Port1_2) connecting with the VM 312, the PE 321 maysend the packet 1 through the user port Port1_2. Ultimately, the packet1 will arrive at the VM 312. This allows the PE 321 to forward thepacket from VM 311 to the VM 312 in a shortest path.

When the PE 321 does not acquire the forwarding entry in the forwardingtable (e.g., there is no entry 2 in the forwarding table), or when thePE 321 finds that the port associated to vPort1_2 used as the egressport in the forwarding entry is an upstream port, the PE 321 may add afirst tag and a second tag to the packet 1. The packet 1 added with thefirst tag and the second tag is referred to as packet 2 herein.

The first tag is an outer tag compared with the second tag, and thesecond tag is an inner tag. The first tag may carry a source ECID whichis the ECID (denoted ECID1) associated with the vPort1_1. The second tagmay carry the VLAN identifier of the VLAN1. For example, the first tagmay be E-Tag, and the second tag may be C-Tag.

The PE 321 may then send the packet 2 through the upstream port.

When receiving the packet 2 through the cascade port connecting with thePE 321, the PE 322 may search the associating relationship table storinga ECID and a vPort relationship for the vPort (denoted as vPort2_1)corresponding to the source ECID in the first tag carried in the packet2.

The PE 322 may search the forwarding table for the forwarding entrymatching the destination MAC address MAC2 of the packet 2 and the VLANidentifier of the VLAN1 carried in the second tag of the packet 2.

If the PE 322 finds that there is no matching forwarding entry in theforwarding table, the packet 2 may be sent to the upper PE or the CBthrough the upstream port.

When the forwarding entry adding condition is satisfied, the PE 322 mayadd a forwarding entry (denoted as entry 3) learned by the packet 2received through the PE 321 in the forwarding table. Here, the egressport of the entry 3 is vPort2_1 associated with the source ECID carriedin the first tag of the packet 2 on the PE 322. The port associated tothe vPort2_1 may be the cascade port through which the PE 322 receivesthe packet 2. The entry 3 may also include the source MAC address MAC1of the packet 2 and the VLAN identifier of the VLAN1 (which is in factalso the VLAN associated with the vPort2_1) carried in the second tag ofthe packet 2. When there is no vPort2_1 on the PE 322, the packet 2 maybe directly discarded and the current flow is ended. Table 3 shows thestructure of the entry 3.

TABLE 3 MAC address Egress port VLAN MAC1 vPort2_1 VLAN1

When receiving the packet 2, the CB 330 may search the forwarding tablefor the forwarding entry matching the VLAN identifier of VLAN1 carriedin the second tag and the destination MAC address MAC2 of the packet 2.If there is no matching forwarding entry in the forwarding table, thepacket 2 may be broadcast in the VLAN1 according to the VLAN identifierof VLAN1 in the second tag of the packet 3. If there is a matchingforwarding entry in the forwarding table, the packet 2 may be forwardedaccording to the matching forwarding entry (the forwarding process issimilar to the prior art, which will not be described here).

Here the bridge CB 330 may broadcast the packet 2 in the VLAN1, whichwill be described as an example.

When the PE 322 receives the packet 2 broadcast by the CB 330, in orderto prevent the MAC address from moving, the PE 322 will no longer learnthe entry in which the MAC address is MAC1 by the packet 2 broadcast bythe CB 330 when the above entry 3 is learned by the packet 2 from the PE321 has not been aged yet.

However, when there is no forwarding entry in which the MAC address isMAC1 in the PE 322, the PE 322 may learn the forwarding entry from thepacket 2 broadcasted by the CB 330. At this time, the MAC address in thelearned forwarding entry is the source MAC address of the packet 2, theegress port is the vPort associated to the upstream port through whichthe packet 2 broadcasted by the CB 330 is received, and the VLANidentifier is the identifier of the VLAN to which the packet 2 belongs.

The packet forwarding mechanism of PE 321 is similar to that of the PE322. Ultimately, the PE 321 will remove the first tag and the second tagcarried in the packet 2. The packet 2 in which the first tag and thesecond tag are removed is denoted as a packet 3, and the PE 321 may sendthe packet 3 to the VM 312.

When receiving the packet 3, if the VM 312 finds that the destinationMAC address MAC2 of the packet 3 is its own MAC address, the VM 312 mayreturn a response packet. The response packet is denoted as a packet 4here. The source MAC address of the packet 4 is MAC2 and its destinationMAC address is MAC1.

The PE 321 may receive the packet 4 through an user port (denoted asPort1_2).

The PE 321 may search the port associating relationship table from theCB 330 for the vPort associated to the user port Port1_2 as the vPortassociated to the Port1_2 through which the packet 4 is received. As anembodiment of the present disclosure, the PE 321 may also determine avPort which is assigned in advance to the user information carried inthe packet 4 as the vPort associated to the Port1_2. Here, the userinformation carried in the packet 4 may include the source MAC addressMAC2 of the packet 4. For ease of description, the vPort associated tothe Port1_2 is denoted as vPort1_2 herein.

When forwarding entry adding condition is satisfied, the PE 321 may adda forwarding entry learned by the packet 4 received through the VM 312(denoted as entry 4) in the forwarding table. Here, the entry 4 mayinclude the vPort1_2 as an egress port, the source MAC address MAC2 ofthe packet 4 as a MAC address and the identifier of the VLAN associatedwith the vPort1_2 (denoted as VLAN11 as a VLAN identifier Table 4 showsthe structure of the entry 4

TABLE 4 MAC address Egress port VLAN MAC2 vPort1_2 VLAN1

The PE 321 may search the forwarding table for a forwarding entrymatching the destination MAC address MAC1 of the packet 4 and the VLANidentifier of the VLAN1. The forwarding entry acquired here is the aboveentry 1.

When acquiring the entry 1, the PE 321 may identify the egress port ofthe entry 1 as vPort1_1.

The PE 321 may search the port associating relationship table for theport associated to the vPort1_1. The PE 321 finds that the portassociated to the vPort1_1 is the user port Port1_1 connecting with theVM 311. The PE 321 may send the packet 4 through the user port Port1_1.Ultimately, the packet 4 will arrive at the VM 311. This allows the PE321 to forward the response packet from the VM 312 to the VM 311 in theshortest path.

Thus, the description of Embodiment 1 is completed.

FIG. 4 schematically illustrates network in which a method of forwardingpacket may be applied, according to Embodiment 2 of the presentdisclosure. In FIG. 4, the VM 413 is connected with the VM 414 throughthe PE 423, and the VM 414 is connected with the PE 424 directly.

In this embodiment, taking the VM 413 accessing the VM 414 as anexample, the above method of forwarding packet is described in detail.

The VM 413 may send a packet. Herein the packet is denoted as packet3_1. The source MAC address of the packet 3_1 is the MAC address of theVM 413 (denoted as MAC3) and the destination MAC address of the packet3_1 is the MAC address of the VM 414 (denoted as MAC4).

The PE 423 may receive the packet 3_1 through a user port (denoted asPort3_3).

The PE 423 may search the port associating relationship table from theCB 431 for the vPort associated to the user port Port3_3. As anembodiment of the present disclosure, the PE 423 may also determine avPort which is assigned in advance to the user information carried inthe packet 3_1 as the vPort associated to the Port3_3. Here, the userinformation carried in the packet 3_1 may include the source MAC addressMAC3 of the packet 3_1. For ease of description, the vPort associated tothe Port3_3 is denoted as vPort3_3 herein.

When the forwarding entry adding condition is satisfied, the PE 423 mayadd a forwarding entry learned by the packet 3_1 received through the VM413 to the forwarding table, e.g., the forwarding entry in which the MACaddress is the source MAC address MAC3 of the packet 3_1 (denoted asentry 3_1). Here, the entry 3_1 may include the vPort3_3 as a egressport, source MAC address MAC3 of the packet 3_1 as a MAC address and theVLAN identifier of the VLAN (denoted as VLAN3_3) associated with thevPort3_3 as a VLAN identifier. Table 5 shows the structure of the entry3_1.

TABLE 5 MAC address Egress port VLAN MAC3 vPort3_3 VLAN3_3

The PE 423 may search the forwarding table for the forwarding entry(denoted as entry 3_2) matching the destination MAC address MAC4 of thepacket 3_1 and the VLAN identifier of the VLAN3_3. The egress port ofthe entry 3_2 is vPort3_4. The case where the entry 3_2 is not acquiredwill be described hereinafter.

The PE 423 may search the port associating relationship table for theport associated to the vPort3_4. When the PE 423 finds that the portassociated to vPort3_4 is an upstream port, the PE 423 may add a firsttag and a second tag to the packet 3_1. The packet 3_1 added with thefirst tag and the second tag is referred to as packet 3_2 herein. Hereinthe first tag is an outer tag compared with the second tag, and thesecond tag is an inner tag. The first tag may carry a source ECID whichis the ECID (denoted ECID3_3) associated with the vPort3_3 on the PE423. The second tag may carry the VLAN identifier of the VLAN3_3. Forexample, the first tag may be E-Tag, and the second tag may be C-Tag.

When the PE 423 does not acquire the entry 3_2 in the forwarding table,the principle of packet forwarding is similar to that in the above casethat the port associated to vPort3_4 is an upstream port. For example,the PE 423 may send the packet 3_2 through the upstream port.

The PE 424 may receive the packet 3_2 through the cascade portconnecting with the PE 423. The PE 424 may search the associatingrelationship table storing a ECID and a vPort relationship of PE 424 forthe vPort (denoted as vPort4_3) corresponding to the source ECID carriedin the packet 3_2.

When the forwarding entry adding condition is satisfied, the PE 424 mayadd a forwarding entry learned by the packet 3_2 received through the PE423 (denoted as entry 3_3) in the forwarding table. Herein, the egressport of the entry 3_3 is the vPort4_3 associated with the source ECIDcarried in the first tag of the packet 3_2 on the PE 424. The portassociated to the vPort4_3 may be the cascade port through which the PE424 receives the packet 3_2. The vPort4_3 on the PE 424 is associatedwith the same ECID as the vPort3_3 on the PE 423, e.g., the source ECIDcarried in the first tag of the packet 3_2. The entry 3_3 may alsoinclude the source MAC address MAC3 of the packet 3_2 and the VLANidentifier of the VLAN3_3 (which is in fact also the VLAN associatedwith the vPort4_3) carried in the second tag. Table 6 shows thestructure of the entry 3_3.

TABLE 6 MAC address Egress port VLAN MAC3 vPort4_3 VLAN3_3

The PE 424 may search the forwarding table for a forwarding entry inmatching the source MAC address MAC4 of the packet 3_2 and the VLANidentifier of the VLAN3_3 carried in the second tag of the packet 3_2.

If the PE 424 finds that there is a matching forwarding entry in theforwarding table (denoted as entry 3_4) and identifies that the egressport of the entry 3_4 is vPort4_4, the PE 424 may search the portassociating relationship table for the port associated to the vPort4_4.

If the PE 424 finds that the port associated to the vPort4_4 is a userport (denoted as Port4_4) connecting with the VM 414, the first tag andthe second tag carried in the packet 3_2 may be removed. The packet 3_2in which the first tag and the second tag are removed is denoted aspacket 3_3 here. The PE 424 may send the packet 3_3 through the userport Port4_4. Ultimately, the packet 3_3 will arrive at the VM 414. Thisallows the PE 424 to forward the packet from the VM 413 to the VM 414 inthe shortest path rather than forward the packet through the CB when VMsconnecting with different PEs on the same tree branch are accessed fromeach other

In Embodiment 2, if the PE 424 does not acquire a matching forwardingentry in the forwarding table, or when the PE 424 finds that the portassociated to the vPort4_4 is an upstream port, the PE 424 may send thepacket 3_2 through the upstream port.

When receiving the packet 3_2, the CB 431 may search the forwardingtable for the forwarding entry matching the VLAN identifier of VLAN3_3carried in the second tag and the destination MAC address MAC4 of thepacket 3_2. If there is no matching forwarding entry in the forwardingtable, the packet 3_2 may be broadcast in the VLAN3_3 according to theVLAN identifier of VLAN3_3 in the second tag of the packet 3_2. If thereis a matching forwarding entry in the forwarding table, the packet 3_2may be forwarded according to the matching forwarding entry. Theforwarding process is similar to a solution know for a skilled in theart, which will not be described here.

Here the bridge CB 431 may broadcast the packet 3_2 in the VLAN3_3,which will be described as an example.

When receiving the packet 3_2 broadcast by the CB 431, in order toprevent the MAC address from moving, the PE 424 will no longer learn theentry in which the MAC address is the MAC address MAC3 by the packet 3_2broadcast by the CB 431 when the above entry 3_3 learned by the packet3_2 from the PE 423 has not been aged yet. The packet forwardingmechanism of PE 423 is similar to that of the PE 424. Ultimately, the PE424 may remove the first tag and the second tag carried in the packet3_2 broadcast by the CB 431 (e.g., the above packet 3_3 is obtained),and then send the packet 3_3 to the VM 414.

However, when there is no forwarding entry in which the MAC address isMAC3 in the PE 424, the PE 424 may learn the forwarding entry from thepacket 3_2 broadcasted by the CB 431. At this time, the MAC address ofthe learned forwarding entry is the source MAC address of the packet3_2, the egress port is the vPort associated to the upstream portthrough which the packet 3_2 broadcasted by the CB 431, and the VLANidentifier is the identifier of the VLAN to which the packet 3_2belongs.

If the VM 414 finds that the destination MAC address MAC4 of the packet3_3 is its own MAC address when receiving the packet 3_3, the VM 414will return a response packet. The response packet is denoted as apacket 3_4 here. The source MAC address of the packet 3_4 is MAC4 andthe destination MAC address of the packet 3_4 is MAC3.

The PE 424 may receive the packet 3_4 through the user port (denoted asPort4_4).

The PE 424 may search the port associating relationship table from theCB 431 for the vPort associated to the user port Port4_4. As anembodiment of the present disclosure, the PE 424 may also determine avPort which is assigned in advance to the characteristic parametercarried in the packet 3_4 as the vPort associated to the Port4_4. Here,the characteristic parameter carried in the packet 3_4 may include thesource MAC address MAC4 of the packet 3_4. For ease of description, thevPort associated with the packet 3_4 is denoted as vPort4_4 herein.

When the forwarding entry adding condition is satisfied, the PE 424 mayadd a forwarding entry learned by the packet 3_4 received through theuser port (denoted as entry 3_5) in the forwarding table. Here, theegress port of the entry 3_5 is the vPort4_4. The entry 3_5 may alsoinclude the source MAC address MAC4 of the packet 3_4 and the VLANidentifier of the VLAN associated with the vPort4_4 (i.e., the aboveVLAN3_3). Table 7 shows the entry 3_5.

TABLE 7 MAC address Egress port VLAN MAC4 vPort4_4 VLAN3_3

The PE 424 may search the forwarding table for a forwarding entrymatching the destination MAC address MAC3 of the packet 3_4 and the VLANidentifier of the VLAN3_3. The forwarding entry acquired here is theabove entry 3_3.

When acquiring the matching forwarding entry, e.g., the entry 3_3, thePE 424 may identify that the egress port of the entry 3_3 is thevPort4_3. The PE 424 may search the port associating relationship tablefor the port associated to the vPort4_3. If the PE 424 finds that theport associated to the vPort4_3 is a cascade port, the PE 424 may add afirst tag and a second tag to the packet 3_4. The packet 3_4 added withthe first tag and the second tag is referred to as the packet 3_5.Herein the source ECID carried in the first tag is the ECID associatedwith the vPort4_4, and the second tag may carry the VLAN identifier ofthe VLAN3_3 (in fact, the VLAN associated with the vPort4_4).

The PE 423 may receive the packet 3_5 through the upstream port.

When the forwarding entry adding condition is satisfied, the PE 423 mayadd a forwarding entry learned by the packet 3_5 received through the PE424 (denoted as entry 3_6) in the forwarding table. Here, the egressport of the entry 3_6 is the vPort (denoted as vPort3_4) associated tothe upstream port through which the PE 423 receives the packet 3_5. Theentry 3_6 may also include the source MAC address MAC4 of the packet 3_5and the VLAN identifier of the VLAN3_3 (in fact, the VLAN associatedwith the vPort3_4) carried in the second tag of the packet 3_5. Table 8shows the entry 3_6.

TABLE 8 MAC address Egress port VLAN MAC4 vPort3_4 VLAN3_3

The PE 423 may search the forwarding table for a forwarding entrymatching the destination MAC address MAC3 and the VLAN identifier of theVLAN3_3 carried in the second tag of the packet 3_5. The forwardingentry acquired here is the entry 3_1.

The PE 423 may identify that the egress port of the entry 3_1 is thevPort3_3. The PE 423 may search the port associating relationship tablefor the port associated to the vPort3_3. If the PE 423 finds that theport associated to the vPort3_3 is the user port (denoted as Port3_3)connecting with the VM 413, the first tag and the second tag of thepacket 3_5 may be removed. The packet 3_5 in which the first tag and thesecond tag are removed is referred to as packet 3_6 herein.

The PE 423 may send the packet 3_6 through the user port Port3_3.Ultimately, the packet 3_6 will arrive at the VM 413. This allows not toforward the packet through the CB when VMs connecting with different PEson the same tree branch are accessed from each other.

Thus, the description of Embodiment 2 is completed.

For the device embodiment, since it corresponds substantially to themethod embodiment, reference is made to the partial description of themethod embodiment for the related part. The device embodiment describedabove is merely illustrative, wherein the unit described as a separatingcomponent may or may not be physically separate, and the component shownas a unit may or may not be a physical unit, which may be located in oneplace or may be distributed to a plurality of network units. A part orall of the modules may be selected according to the actual needs toachieve the object of the solution of the present disclosure. One ofordinary skill in the art will understand and practice without payingcreative work.

The method of forwarding packet provided in the present disclosure hasbeen described above. A device for forwarding packet provided in thepresent disclosure will be described below.

FIG. 5 is a hardware structural diagram of a PE according to the presentdisclosure. In addition to a processor 511, a machine-readable storagemedium 512, a forwarding chip 513, and an internal bus 514 shown in FIG.5, the PE device may also include other hardware according to the actualfunction of the PE device, which will not be described herein.

In a different embodiment, the machine-readable storage medium 512 maybe a Radom Access Memory (RAM), a volatile memory, a non-volatilememory, a flash memory, a storage drive (such as a hard disk drive), asolid state drive, any type of storage disk (for example, optical disk,DVD, etc.), or a similar storage medium, or a combination thereof.

Further, the above forwarding chip 513 may receive a packet; theforwarding chip 513 may determine a first vPort associated to the portthrough which the packet is received.

The above forwarding chip 513 may send the packet to the processor 511,and the processor 511 may invoke a machine-readable instruction for alogic of adding an entry saved in the above machine-readable storagemedium 512 when a forwarding entry adding condition is satisfied. Thelogic of adding an entry may be as follows: adding a first forwardingentry in a forwarding table, by recording the first vPort as an egressport in the first forwarding entry, recording a source MAC address ofthe packet as a MAC address in the first forwarding entry, and recordingthe VLAN identifier of the VLAN associated with the first vPort as aVLAN identifier in the first forwarding entry.

For example, after determining the first vPort, the above forwardingchip 513 may add a first tag into the packet and the first tag may carrythe ECID associated to the first vPort. The above forwarding chip 513may send the packet added with the first tag to the processor 511, andthe processor 511 may determine the first vPort associated with the ECIDcarried in the packet. When the forwarding entry adding condition issatisfied, a forwarding entry for the packet may be added, by recordinga source MAC address of the packet as a MAC address in the forwardingentry, recording the first vPort as a egress port in the forwardingentry, and recording the VLAN identifier of the VLAN associated with thefirst vPort as a VLAN identifier.

The above forwarding chip 513 may search the forwarding table for asecond forwarding entry matching the destination MAC address of thepacket and the VLAN identifier of the VLAN to which the packet belongs.

The above forwarding chip 513 may search a port associating relationshiptable for a port associated to a second vPort in the second forwardingentry, and the above forwarding chip 513 may forward the packet throughthe port associated to the second vPort.

According to an example, the above forwarding chip 513 may determine thefirst vPort associated to the port through which the packet is received,including that: the forwarding chip 513 may search the port associatingrelationship table for a vPort which is associated to a first user portwhen the packet is received through the first user port; the forwardingchip 513 may determine the a vPort which is assigned in advance to acharacteristic parameter carried in the packet as the first vPort whenthe packet is received through a first user port; the forwarding chip513 may determine the vPort which is associated to a source ECID carriedin the first tag of the packet as the first vPort when the packet isreceived through a first cascade port.

According to another example, the above forwarding chip 513 may forwardthe packet through the port associated to the second vPort, includingthat: the forwarding chip 513 may send the packet which is generated byadding a first tag and a second tag to the packet through an upstreamport when the port associated to the second vPort is the upstream portand the packet is received through a first user port; the forwardingchip 513 may send the packet which is generated by adding a first tagand a second tag to the packet through a second cascade port when theport associated to the second vPort is the second cascade port and thepacket is received through a first user port; the forwarding chip 513may send the packet through a second user port when the port associatedto the second vPort is the second user port and the packet is receivedthrough a first user port; the forwarding chip 513 may send the packetthrough an upstream port when the port associated to the second vPort isthe upstream port and the packet is received through a first cascadeport; the forwarding chip 513 may send the packet through a secondcascade port when the port associated to the second vPort is the secondcascade port and the packet is received through a first cascade port;the forwarding chip 513 may send the packet which is generated byremoving the first tag and the second tag through a second user portwhen the port associated to the second vPort is the second user port andthe packet is received through a first cascade port; wherein the firsttag may carry a source ECID, the source ECID is an ECID associated withthe first vPort, and the second tag may carry an VLAN identifier of theVLAN associated with the first vPort.

According to another example, the forwarding chip 513 may send thepacket which is generated by adding a first tag and a second tag to thepacket through an upstream port when the second forwarding entry is notacquired from the forwarding table and the packet is received through afirst user port; the forwarding chip 513 may send the packet through anupstream port when the second forwarding entry is not acquired in theforwarding table and the packet is received through a first cascadeport; wherein the first tag may carry a source ECID, the source ECID isan ECID associated with the first vPort, and the second tag may carry anVLAN identifier of the VLAN associated with the first vPort.

According to another example, the above forwarding chip 513 may searchthe forwarding table for a second forwarding entry matching thedestination MAC address of the packet and a VLAN identifier of a VLAN towhich the packet belongs, including that: the above forwarding chip 513may search the forwarding table for a second forwarding entry matchingthe destination MAC address of the packet and the VLAN identifier of theVLAN associated with the first vPort when the packet is received througha first user port; the above forwarding chip 513 may search theforwarding table for a second forwarding entry matching the destinationMAC address of the packet and the VLAN identifier in a second tagcarried in the packet when the packet is received through a cascadeport, wherein the second tag may carry the VLAN identifier of the VLANassociated with the first vPort.

According to another example, the forwarding entry adding condition mayinclude any one or more of the followings: there is no forwarding entryin which the MAC address is the source MAC address of the packet in theforwarding table; or the packet is received through a user port, and theforwarding entry in which the MAC address is the source MAC address ofthe packet in the forwarding table is learned from another packetreceived through the upstream port.

For the device embodiment, since it corresponds substantially to themethod embodiment, reference is made to the partial description of themethod embodiment for the related part. The device embodiment describedabove is merely illustrative, wherein the unit described as a separatingcomponent may or may not be physically separate, and the component shownas a unit may or may not be a physical unit, which may be located in oneplace or may be distributed to a plurality of network units. A part orall of the modules may be selected according to the actual needs toachieve the object of the solution of the present disclosure. One ofordinary skill in the art will understand and practice without payingcreative work.

It is to be noted that, in this context, relational terms such as afirst and a second are used only to distinguish an entity or anoperation from another entity or operation without necessarily requiringor implying that there is any such actual relationship or sequencebetween these entities or operations. The terms such as “including”,“containing”, or any other variants thereof are intended to encompass anon-exclusive inclusion such that a process, a method, an article or adevice including a series of elements includes not only those elements,but also includes other elements that are not listed clearly or theelements that are inherent to this process, method, article, or device.In the absence of more restrictions, the elements defined by thestatement “including a . . . ” do not preclude the presence of theadditional same elements in the process, method, article, or device thatincludes the elements.

The method and device provided in the embodiments of the presentdisclosure have been described in detail. The principles and embodimentsof the present disclosure have been described with reference to specificexamples herein. The description of the above embodiments is merely forhelping understand the method of the present disclosure and its coreidea. Meanwhile, those skilled in the art may change the specificembodiments and the scope of application according to the idea of thepresent disclosure. In summary, the content of the present specificationshould not be construed as limiting the present disclosure.

1. A method of forwarding packet, comprising: receiving, by a PortExtender (PE), a packet; determining, by the PE, a first Virtual Port(vPort) associated to a port through which the packet is received;adding, by the PE, a first forwarding entry in a forwarding table inresponse to a forwarding entry adding condition is satisfied, byrecording the first vPort as an egress port in the first forwardingentry, recording a source Media Access Control (MAC) address of thepacket as a MAC address in the first forwarding entry, and recording aVirtual Local Area Network (VLAN) identifier of a VLAN associated withthe first vPort as a VLAN identifier in the first forwarding entry;searching, by the PE, the forwarding table for a second forwarding entrymatching a destination MAC address of the packet and a VLAN identifierof the VLAN to which the packet belongs; and searching, by the PE, aport associating relationship table for a port which is associated to asecond vPort in the second forwarding entry; and forwarding, by the PE,the packet through the port associated to the second vPort.
 2. Themethod according to claim 1, wherein determining the first vPortcomprises: searching, by the PE, the port associating relationship tablefor a vPort which is associated to a first user port as the first vPortin response to the packet is received through the first user port;determining, by the PE, a vPort which is assigned in advance to acharacteristic parameter carried in the packet as the first vPort inresponse to the packet is received through a first user port;determining, by the PE, a vPort which is associated to a source E-tagChannel Identifier (ECID) carried in a first tag of the packet as thefirst vPort in response to the packet is received through a firstcascade port.
 3. The method according to claim 1, wherein forwarding thepacket through the port associated to the second vPort comprises:sending, by the PE, a packet which is generated by adding a first tagand a second tag to the packet through an upstream port in response tothe port associated to the second vPort is the upstream port and thepacket is received through a first user port; sending, by the PE, apacket which is generated by adding a first tag and a second tag to thepacket through a second cascade port in response to the port associatedto the second vPort is the second cascade port and the packet isreceived through a first user port; sending, by the PE, the packetthrough a second user port in response to the port associated to thesecond vPort is the second user port and the packet is received througha first user port; sending, by the PE, the packet through an upstreamport in response to the port associated to the second vPort is theupstream port and the packet is received through a first cascade port;sending, by the PE, the packet through a second cascade port in responseto the port associated to the second vPort is the second cascade portand the packet is received through a first cascade port; sending, by thePE, a packet which is generated by removing the first tag and the secondtag from the packet through a second user port in response to the portassociated to the second vPort is the second user port and the packet isreceived through a first cascade port; wherein the first tag carries asource ECID, the source ECID is an ECID associated with the first vPort,and the second tag carries an VLAN identifier of the VLAN associatedwith the first vPort.
 4. The method according to claim 1, furthercomprising: sending, by the PE, a packet generated by adding a first tagand a second tag to the packet through an upstream port in response tothe second forwarding entry is not acquired from the forwarding tableand the packet is received through a first user port; sending, by thePE, the packet through an upstream port in response to the secondforwarding entry is not acquired from the forwarding table and thepacket is received though a first cascade port; wherein the first tagcarries a source ECID, the source ECID is an ECID associated with thefirst vPort, and the second tag carries an VLAN identifier of the VLANassociated with the first vPort.
 5. The method according to claim 1,wherein searching the forwarding table for a second forwarding entrymatching the destination MAC address of the packet and the VLANidentifier of the VLAN to which the packet belongs comprises: searching,by the PE, the forwarding table for a second forwarding entry matchingthe destination MAC address of the packet and the VLAN identifier of theVLAN associated with the first vPort in response to the packet isreceived through a first user port; searching, by the PE, the forwardingtable for a second forwarding entry matching the destination MAC addressof the packet and the VLAN identifier in a second tag carried by thepacket in response to the packet is received through a cascade port,wherein the second tag carries the VLAN identifier of the VLANassociated with the first vPort.
 6. The method according to claim 1,wherein the forwarding entry adding condition comprises any one or moreof the following: there is no forwarding entry in which the MAC addressis the source MAC address of the packet in the forwarding table; or thepacket is received through a user port, and the forwarding entry inwhich the MAC address is the source MAC address of the packet in theforwarding table is learned from a packet received through an upstreamport.
 7. A Port Extender (PE), comprising a processor and a forwardingchip, wherein receiving, by the forwarding chip, a packet; determining,by the forwarding chip, a first Virtual Port (vPort) associated to aport through which the packet is received; sending, by the forwardingchip, the packet to the processor, and adding, by the processor, a firstforwarding entry in a forwarding table in response to a forwarding entryadding condition is satisfied, by recording the first vPort as an egressport in the first forwarding entry, recording a source MAC address ofthe packet as a Media Access Control (MAC) address in the firstforwarding entry, and recording a VLAN identifier of a VLAN associatedwith the first vPort as a Virtual Local Area Network (VLAN) identifierin the first forwarding entry; searching, by the forwarding chip, theforwarding table for a second forwarding entry matching a destinationMAC address of the packet and a VLAN identifier of a VLAN to which thepacket belongs; searching, by the forwarding chip, a port associatingrelationship table for a port associated to a second vPort in the secondforwarding entry; and forwarding, by the forwarding chip, the packetthrough the port associated to the second vPort.
 8. The PE according toclaim 7, wherein the forwarding chip determines the first vPortcomprises: searching, by the forwarding chip, the port associatingrelationship table for a vPort associated to a first user port as thefirst port in response to the packet is received through the first userport; determining, by the forwarding chip, a vPort which is assigned inadvance to a characteristic parameter carried in the packet as the firstport in response to the packet is received through a first user port;determining, by the forwarding chip, a vPort which is associated to asource E-tag Channel Identifier (ECID) carried in a first tag of thepacket as the first vPort in response to the packet is received througha first cascade port.
 9. The PE according to claim 7, whereinforwarding, by the forwarding chip, the packet through the portassociated to the second vPort comprises: sending, by the forwardingchip, the packet which is generated by adding a first tag and a secondtag to packet through an upstream port in response to the portassociated to the second vPort is the upstream port and the packet isreceived through a first user port; sending, by the forwarding chip, thepacket which is generated by adding a first tag and a second tag topacket through a second cascade in response to the port associated tothe second vPort is the second cascade and the packet is receivedthrough a first user port; sending, by the forwarding chip, the packetthrough a second user port in response to the port associated to thesecond vPort is the second user port and the packet is received througha first user port; sending, by the forwarding chip, the packet throughan upstream port in response to the port associated to the second vPortis the upstream port and the packet is received through a first cascadeport; sending, by the forwarding chip, the packet through a secondcascade port in response to the port associated to the second vPort isthe second cascade port and the packet is received through a firstcascade port; sending, by the forwarding chip, the packet which isgenerated by removing the first tag and the second tag from the packetthrough a second user port in response to the port associated to thesecond vPort is the second user port and the packet is received througha first cascade port; wherein the first tag carries a source ECID, thesource ECID is an ECID associated with the first vPort, and the secondtag carries an VLAN identifier of the VLAN associated with the firstvPort.
 10. The PE according to claim 7, wherein sending, by theforwarding chip, the packet which is generated by adding a first tag anda second tag to the packet through an upstream port in response to thesecond forwarding entry is not acquired from the forwarding table andthe packet is received through a first user port; sending, by theforwarding chip, the packet through an upstream port in response to thesecond forwarding entry is not acquired from the forwarding table andthe packet is received through a first cascade port; wherein the firsttag carries a source ECID, the source ECID is an ECID associated withthe first vPort, and the second tag carries an VLAN identifier of theVLAN associated with the first vPort.
 11. The PE according to claim 7,wherein searching the forwarding table for a second forwarding entrymatching the destination MAC address of the packet and the VLANidentifier of the VLAN to which the packet belongs, comprising:searching, by the forwarding chip, the forwarding table for a secondforwarding entry matching the destination MAC address of the packet andthe VLAN identifier of the VLAN associated with the first vPort inresponse to the packet is received through a first user port; searching,by the forwarding chip, the forwarding table for a second forwardingentry matching the destination MAC address of the packet and the VLANidentifier in a second tag carried in the packet in response to thepacket is received through a cascade port, wherein the second tagcarries the VLAN identifier of the VLAN associated with the first vPort.12. The PE according to claim 7, wherein the forwarding entry addingcondition comprises any one or more of the following: there is noforwarding entry in which the MAC address is the source MAC address ofthe packet in the forwarding table; or the packet is received through auser port, and the forwarding entry in which the MAC address is thesource MAC address of the packet in the forwarding table is learned froma packet received through an upstream port.